package indi.defoliation.unknownrpg.api.rpgevent.player;

import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;

import indi.defoliation.unknownrpg.api.attribute.Attribute;
import indi.defoliation.unknownrpg.api.rpgevent.Cancellable;

public class PlayerRightClickEvent extends PlayerClickEvent implements Cancellable{
	
	private boolean cancel;
	
	public PlayerRightClickEvent(Player who,Block clickBlock) {
		super(who,clickBlock);
	}
	
	public PlayerRightClickEvent(Player p,Entity entity) {
		super(p,entity);
	}
	
	@Override
	public void setCancelled(Attribute operoter, boolean cance) {
		if(this.cancel==cance)
			return;
		this.cancel=cance;
		super.getTable().addAction(operoter, super.clone());
		
	}

	@Override
	public boolean isCancelled() {
		return cancel;
	}
}
